#'
#' split a community into a list of populations
#'
#' @param com a community object
#'
#'
#' @return
#' a list of population objects with the name of the species
#' 
#' 
#' @examples
#' 
#' set.seed(1)
#' 
#' com=rcommunity()
#' split(com)
#' 
#' @export
split.community=function(com){
  S=total_richness(com)
  spab=species_abundance(com)
  splist=names(spab)
  
  poplist=list()
  for(i in 1:S){
    poplist[[i]]=get_population(com,splist[i])
  }
  names(poplist)=splist
  return(poplist)
}